用Laravel開發系統,那就用Laradock架設環境吧!
首先到 Laradock 下載方式:
這邊的範例使用Git
$ git clone https://github.com/Laradock/laradock.git
$ cp .env.example .env
### Paths #################################################
### 專案存放的路徑
# Point to the path of your applications code on your host
APP_CODE_PATH_HOST=../Project/
# Point to where the `APP_CODE_PATH_HOST` should be in the container
APP_CODE_PATH_CONTAINER=/var/www
### 啟用指定PHP版本
# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM).
# Accepted values: 8.0 - 7.4 - 7.3 - 7.2 - 7.1 - 7.0 - 5.6
PHP_VERSION=8.0
### MySQL設定
### MYSQL #################################################
MYSQL_VERSION=latest
MYSQL_DATABASE=default
MYSQL_USER=default
MYSQL_PASSWORD=secret
MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=root
MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d
docker-compose up -d nginx mysql phpmyadmin redis workspace